package com.distribution.business.service;

import com.distribution.business.dto.UserInfoDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.Date;

@Slf4j
@Service
public class UserService {

    @Value("${test.user.name}")
    private String userName;

    @Value("${test.user.address}")
    private String userAddress;

    @Value("${test.user.address2}")
    private String userAddress2;


    public String getUserName(){
        log.debug("getUserName service log");
        return  "user name is : " +  this.userName + " and address is: " + this.userAddress +
                " and address2 is:" + this.userAddress2;
    }

    public UserInfoDto getUserInfo2(){
        UserInfoDto user = new UserInfoDto();
        user.setName("张安");
        user.setCreatedDate(new Date());
        user.setBirthday(new Date());
        user.setAge(18);
        user.setActive(true);
        user.setAddress("guangzhou");
        user.setHobbies(Arrays.asList(new String[]{"aa","bb","cc"}));
        return user;
    }
}
